import { createRouter, createWebHistory } from 'vue-router'
import HomePage from '../views/HomePage.vue'
import ProductsPage from '../views/ProductsPage.vue'
import ProductDetailPage from '../views/ProductDetailPage.vue'
import PlatformIntroductionPage from '../views/PlatformIntroductionPage.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomePage
    },
    {
      path: '/products',
      name: 'products',
      component: ProductsPage
    },
    {
      path: '/products/:id',
      name: 'productDetail',
      component: ProductDetailPage,
      props: true
    },
    {
      path: '/about',
      name: 'about',
      component: PlatformIntroductionPage
    }
  ]
})

export default router